function a1() {
    var arr =[
    "鹿晗",
    "王俊凯",
    "蔡徐坤",
    "彭于晏",
    "周杰伦",
    "刘德华",
    "赵本山",
    ];
    var len = arr . length;
    for(vari=0;
    i<len/2;i++){
    var tmp = arr[i];
    arr [i]
    arr[len一1 - i];
    arr[len-1-i]=tmp;
    }
    console. log(arr);
}
a1( );
function getDayNum(str) {
return new Date(str) . getDate();
}
console. log( getDayNum( " 2019-1-2"));
function getRandomInteger ( min,max) {
return Math. floor (Math. random( ) * ( max,min)) + min;
}
function a3() {
    var str="#";
    const values =[
        "0",
        "1",
        "2",
        "3",
        "4",
        "5",
        "6",
        "7",
        "8",
        "9",
        "A",
        "B",
        "C",
        "D",
        "E",
        "F",
    ];
    for(vari=0;i<6;i++){
        str += values [ getRandomInteger(0, values. length)];
        }
        return str;
        }
        console.log(a3());
        function a4() {
            var str = " abaasdffggghhjjkkgfddsssss3444343" ;
      
            console . log(str .length);
   
            console. log(str . charAt(0));
            console. log(str . charAt(3));
            console. log(str .charAt(5));
            console. log(str . charAt(9));
    
            console . log( str . indexOf("i"));
            console. log( str . index0f("c"));
            console . log(str . index0f("b"));
 
            console. log(str .replace("g","22" ));
            console. log(str . replace("ss", "b"));
 
console .log( str . substring(1, 5));

varmap=newMap();
for(vari=0;i<str.length;i++){
var C = str. charAt(i) ;
var old = map.get(c);
if (old
== undefined) {
old = 0;
}
map.set(c, old + 1);
}
var maxChar = null ;
map . forEach( function logMapElements (value, key) {
if (maxChar == null川value > map. get(maxChar)) {
maxChar = key;
}
});
console. log( maxChar + ":"+ map. get (maxChar) );

console.log("@" + str + "@" );
}
a4();
function a5() {
    var arr =[
    "鹿晗",
    "王俊凯",
    "蔡徐坤",
    "彭于晏",
    "周杰伦",
    "刘德华",
    "赵本山",
    ];
    var result = [];
    while (result.length < 4) {
    var v = arr[ getRandomInteger(0, arr .length)];
    if (!result. find((obj) => obj == v)) {
    result[result. length] = v;
    }
    }
    console.log( result. toString());
}
a5();
function a6() {
var arr =[
"鹿晗",
"王俊凯",
"蔡徐坤",
"彭于晏",
"周杰伦",
"刘德华",
"赵本山",
];
arr .sort((a, b) => getRandomInteger(-1, 2));
console . log(arr . toString());
3}
a6(); 